<?php

/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator          |
    |              on 2018-07-17 15:20:02              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
namespace MmqmMarket\controller\mobile;

defined("IN_IA") || die("Access Denied");
class MarketIndex extends \MmqmMarket\controller\BaseController
{
    public function __construct($Site, $arguments)
    {
        parent::__construct($Site, $arguments);
        method_exists($this, $GLOBALS["_GPC"]["ac"]) && ($this->{$GLOBALS["_GPC"]["ac"]}() && die || die);
        $GLOBALS["PARAMS"] = array("market" => pdo_get($this->table_area, array("weid" => $GLOBALS["_W"]["uniacid"], "id" => intval($GLOBALS["_GPC"]["market_id"]), "status" => 1)), "types" => pdo_getall($this->table_type, array("status" => 1)));
        include $this->template();
    }
    private function nextTypeStores()
    {
        $type = \MmqmMarket\model\SQL::one("\nSELECT *\nFROM `@#__M_type`\nWHERE `status` = 1\nORDER BY `displayorder` DESC\nLIMIT 1\nOFFSET " . intval($GLOBALS["_GPC"]["exists"]), array());
        $stores = pdo_getall($this->table_stores, array("areaid" => intval($GLOBALS["_GPC"]["market_id"]), "typeid" => $type["id"]), array(), '', "`displayorder` DESC");
        die(json_encode(array("type" => $type, "stores" => $stores)));
    }
}